extends CanvasLayer

var inventory: Array = ["void", "void", "void"]
# Called when the node enters the scene tree for the first time.
func _ready():
	pass

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
	pass

func get_all_children(in_node,arr:=[]):
	arr.push_back(in_node)
	for child in in_node.get_children():
		arr = get_all_children(child,arr)
	return arr

## Place color in wand UI slots. void is no color
func ui_object_color(slot, object):
	inventory[slot] = object
	var objects = get_all_children($Test_ui/Objects)
	
	for i in inventory.size():
		if inventory[i] == "void":
			objects[3*i+1].visible = false
			objects[3*i+2].visible = false
			objects[3*i+3].visible = false
		elif inventory[i] == "red":
			objects[3*i+1].visible = true
			objects[3*i+2].visible = false
			objects[3*i+3].visible = false
		elif inventory[i] == "blue":
			objects[3*i+1].visible = false
			objects[3*i+2].visible = true
			objects[3*i+3].visible = false
		elif inventory[i] == "yellow":
			objects[3*i+1].visible = false
			objects[3*i+2].visible = false
			objects[3*i+3].visible = true
			

